<%@ page contentType="text/html; charset=utf-8" language="java"
	import="java.sql.*" errorPage=""%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>	
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>大类栏目管理</title>
<link href="style/admin.css" rel="stylesheet" type="text/css">
</head>

<body>
	<jsp:include page="header.jsp">
		<jsp:param value='<%=request.getAttribute("level")%>' name="level" />
	</jsp:include>

	<div id="body-contents">
		<img id="logo" src="images/category.gif">

		<div id="workspace">

			<h3 id="title">
			
			<c:if test="${param.op eq 'update' }">
			    更新商品大类
			    
			  <c:set var="op" value="更新" />
			    
			</c:if>
			<c:if test="${param.op eq 'delete' }">
			    删除商品大类
			    <c:set var="op" value="删除" />
			</c:if>
			
			<c:if test="${param.op eq 'add' }">
			    增加商品大类
			    <c:set var="op" value="增加" />
			</c:if>
			
			</h3>

            <form action="">
                
               <label> 
                                            操作：<input type="submit" value="${op}">
               </label>
            
            </form>  
			
<!--定义js标签：实现向服务发出请求 -->
<script type="text/javascript">

   //定义操作方法
   function execute(op){
	 //封装表单中的参数，并向服务发出请求
	   //1、告诉浏览器提交表单
	   var form=document.getElementById("op-form");
	   var opElem=document.getElementById("op");
	   opElem.value=op;
	   form.submit();//向服务器发出请求
	   //2、使用ajax技术提交表单
   }
    
   window.onload=function(){
	 
	 
	 //找到指定的按键，为其添加事件
	 var addBtn=document.getElementById("add-btn");
	 addBtn.onclick=function(){
		 
		  execute("insert");
		   
	 };
	 var updateBtn=document.getElementById("update-btn");
	 updateBtn.onclick=function(){

		 execute("update");
		 
	 };
	 var delBtn=document.getElementById("del-btn");
	 delBtn.onclick=function(){

		 execute("delete");
		 
	 };
	  
   }
   
</script>

		</div>


	</div>

	<jsp:include page="footer.jsp" />
</body>
</html>